﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Collections;
using System.Xml.Serialization;

namespace WorkRecorder.Business
{
    [Serializable]
    [DataContract]
    public class Record : IComparer 
    {
        public Record() { WorkRecordId = Guid.NewGuid(); }

        [DataMember]
        private Guid workRecordId;

        public Guid WorkRecordId
        {
            get { return workRecordId; }
            set
            {
                if (WorkRecordId == null || WorkRecordId.Equals(Guid.Empty) )
                {
                    workRecordId = value;
                }

            }
        }


        private DateTime startTime;

        [DataMember]
        public DateTime StartTime
        {
            get { return startTime; }
            set { startTime = value; }
        }

        private DateTime endTime;

        [DataMember]
        public DateTime EndTime
        {
            get { return endTime; }
            set { endTime = value; }
        }

        [DataMember]
        private long timeElapsed;

        public long TimeElapsed
        {
            get { return timeElapsed; }
            set { timeElapsed = value; }
        }


        //private TimeSpan timeElapsed;
        
        //[XmlIgnore]         
        //public TimeSpan TimeElapsed
        //{
        //    get { return  timeElapsed; }
        //    set { timeElapsed = value; timeElapsedTicks = value.Ticks; }
        //}

        private string rType;
        [DataMember]
        public string RType
        {
            get { return rType; }
            set { rType = value; }
        }

        private string comments;

        [DataMember]
        public string Comments
        {
            get { return comments; }
            set { comments = value; }
        }

        //private List<Comment> comments = new List<Comment>();

        //public List<Comment> Comments
        //{
        //    get { return comments; }
        //    set { comments = value; }
        //}

        //[DataMember]       
        public int Compare(object x, object y)
        {
            throw new NotImplementedException();
        }

 

    }
}
